package ${pojoPackage};

import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.kh.first.utils.LongJsonSerializer;
import org.springframework.format.annotation.DateTimeFormat;

public class ${beanName}${beanPostfix} {
<#list columns as col>
    <#if col.DATA_TYPE?contains("int")>
    <#--整数，int或者long-->
    <#if col.COLUMN_NAME?lower_case == pri?lower_case>
    @JsonSerialize(using = LongJsonSerializer.class)
    </#if>
    private <@superSub content=col/> ${col.COLUMN_NAME};
    <#elseif col.DATA_TYPE?contains("date")>
    <#-- 时间格式 生成三段 -->
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ${col.COLUMN_NAME};
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date ${col.COLUMN_NAME}Start;
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date ${col.COLUMN_NAME}End;
    <#elseif col.DATA_TYPE?contains("decimal")>
    private Decimal ${col.COLUMN_NAME};
    <#elseif col.DATA_TYPE?lower_case?matches(".*(text|char).*")>
    private String ${col.COLUMN_NAME} ;
    <#else >
    //TODO 有一个未知类型 ${col.DATA_TYPE}  ${col.COLUMN_NAME}
    </#if>
</#list>
    private Integer start;
    private Integer size;

<#list columns as col>
    <#if col.DATA_TYPE?contains("int")>
    public <@superSub content=col/> get${col.COLUMN_NAME?cap_first}() {
        return ${col.COLUMN_NAME};
    }
    public void set${col.COLUMN_NAME?cap_first}(<@superSub content=col/> ${col.COLUMN_NAME}) {
        this.${col.COLUMN_NAME} = ${col.COLUMN_NAME};
    }

    <#elseif col.DATA_TYPE?contains("date")>
    public Date get${col.COLUMN_NAME?cap_first}() {
        return ${col.COLUMN_NAME};
    }
    public void set${col.COLUMN_NAME?cap_first}(Date ${col.COLUMN_NAME}) {
        this.${col.COLUMN_NAME} = ${col.COLUMN_NAME};
    }

    public Date get${col.COLUMN_NAME?cap_first}Start() {
        return ${col.COLUMN_NAME}Start;
    }
    public void set${col.COLUMN_NAME?cap_first}Start(Date ${col.COLUMN_NAME}Start) {
        this.${col.COLUMN_NAME}Start = ${col.COLUMN_NAME}Start;
    }

    public Date get${col.COLUMN_NAME?cap_first}End() {
        return ${col.COLUMN_NAME}End;
    }
    public void set${col.COLUMN_NAME?cap_first}End(Date ${col.COLUMN_NAME}End) {
        this.${col.COLUMN_NAME}End = ${col.COLUMN_NAME}End;
    }

    <#elseif col.DATA_TYPE?contains("decimal")>
    public Decimal get${col.COLUMN_NAME?cap_first}() {
        return ${col.COLUMN_NAME};
    }
    public void set${col.COLUMN_NAME?cap_first}(Decimal ${col.COLUMN_NAME}) {
        this.${col.COLUMN_NAME} = ${col.COLUMN_NAME};
    }

    <#elseif col.DATA_TYPE?lower_case?matches(".*(text|char).*")>
    public String get${col.COLUMN_NAME?cap_first}() {
        return ${col.COLUMN_NAME};
    }
    public void set${col.COLUMN_NAME?cap_first}(String ${col.COLUMN_NAME}) {
        this.${col.COLUMN_NAME} = ${col.COLUMN_NAME};
    }

    <#else >
    //TODO 有一个未知类型 ${col.DATA_TYPE}  ${col.COLUMN_NAME}
    </#if>
</#list>
    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }
}
